home *** CD-ROM | disk | FTP | other *** search
- @echo off
- if "%1"=="" goto Usage
- if "%1"=="1" goto invalid
- if "%1"=="/?" goto Usage
- if "%1"=="/H" goto Usage
- if "%1"=="/h" goto Usage
- if "%2"=="/?" goto Usage
- if "%2"=="/H" goto Usage
- if "%2"=="/h" goto Usage
-
- echo
- echo ║Creating standard sacrificial GOAT file set for Size= %1
- echo ╚═══════════════════════════════════════════════════════════
-
- echo ║Creating standard sacrificial GOAT file set for Size= %1 >goatset.log
- echo ╚═══════════════════════════════════════════════════════════ >>goatset.log
-
- echo
- echo
- echo │Creating COM files first.
- echo └─────────────────────────────────
- echo
-
- echo >>goatset.log
- echo >>goatset.log
- echo │Creating COM files first.>>goatset.log
- echo └─────────────────────────────────>>goatset.log
- echo >>goatset.log
-
- echo Code at start, 0-filled, JMP present >!.tmp
- goat %1 /c/i0 >>!.tmp
- type !.tmp>>goatset.log
- rem "!.tmp" is a temporary file, deleted on exit from batch.
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf1
- type !.tmp
- :comf1
-
- echo Code at start, 0-filled, no JMP (/J)>!.tmp
- goat %1 /c /j/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf2
- type !.tmp
- :comf2
-
- echo Code at start, NOPs-filled, JMP present (/9)>!.tmp
- goat %1 /c /9 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf3
- type !.tmp
- :comf3
-
- echo Code at bottom, 0-filled, JMP present (/B)>!.tmp
- goat %1 /c /b/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf4
- type !.tmp
- :comf4
-
- echo NOPs-filled, code at bottom, JMP present (/B/9)>!.tmp
- goat %1 /c /b/9 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf5
- type !.tmp
- :comf5
-
- echo NOPs-filled, code at bottom, no JMP (/B/9/J)>!.tmp
- goat %1 /c /b/9/j >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf7
- type !.tmp
- :comf7
-
- echo Code at start, 0-filled, JMP present, readonly (/R) >!.tmp
- goat %1 /c /r/i0>>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf8
- type !.tmp
- :comf8
-
- echo Code at start, 0-filled, no JMP, readonly (/J/R)>!.tmp
- goat %1 /c /j/r/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf9
- type !.tmp
- :comf9
-
- echo Code at start, NOPs-filled, JMP present, readonly (/9/R)>!.tmp
- goat %1 /c /9/r >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf10
- type !.tmp
- :comf10
-
- echo Code at bottom, 0-filled, JMP present, readonly (/B/R)>!.tmp
- goat %1 /c /b/r/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf11
- type !.tmp
- :comf11
-
- echo NOPs-filled, code at bottom, JMP present (/B/9/R)>!.tmp
- goat %1 /c /b/9/r >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf12
- type !.tmp
- :comf12
-
- echo NOPs-filled, code at bottom, no JMP, readonly (/B/9/J/R)>!.tmp
- goat %1 /c /b/9/j/r >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto comf14
- type !.tmp
- :comf14
-
- echo
- echo
- echo │Creating EXE files with 512-bytes header.
- echo └─────────────────────────────────────────────────
- echo
-
- echo >>goatset.log
- echo >>goatset.log
- echo │Creating EXE files with 512-bytes header. >>goatset.log
- echo └───────────────────────────────────────────────── >>goatset.log
- echo >>goatset.log
-
- echo EXE file (MZ header-512), 0-filled, code at start, JMP present (/E)>!.tmp
- goat %1 /c /e/i0 >>!.tmp
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe1
- type !.tmp
- :exe1
-
- echo EXE file (MZ header-512), 0-filled, code at start, no JMP (/E/J)>!.tmp
- goat %1 /c /e/j/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe2
- type !.tmp
- :exe2
-
- echo EXE file (MZ header-512), NOPs-filled, code at start, JMP present (/E/9)>!.tmp
- goat %1 /c /e/9 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe3
- type !.tmp
- :exe3
-
- echo EXE file (MZ header-512), 0-filled, code at bottom, JMP present (/E/B)>!.tmp
- goat %1 /c /e/b/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe4
- type !.tmp
- :exe4
-
- echo EXE file (MZ header-512), NOPs-filled, code at bottom, JMP present (/E/B/9)>!.tmp
- goat %1 /c /e/b/9 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe5
- type !.tmp
- :exe5
-
- echo EXE file (MZ header-512), 0-filled, code at bottom, no JMP (/E/B/J)>!.tmp
- goat %1 /c /e/b/j/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe6
- type !.tmp
- :exe6
-
- echo EXE file (MZ header-512), NOPs-filled, code at bottom, no JMP (/E/B/9/J)>!.tmp
- goat %1 /c /e/b/9/j >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe7
- type !.tmp
- :exe7
-
- echo MZ header-512, 0-filled, code at start, JMP present, readonly (/E/R)>!.tmp
- goat %1 /c /e/r/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe1
- type !.tmp
- :rexe1
-
- echo MZ header-512, 0-filled, code at start, no JMP,readonly (/E/J/R)>!.tmp
- goat %1 /c /e/j/r/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe2
- type !.tmp
- :rexe2
-
- echo MZ header-512, NOPs-filled, code at start, JMP present, readonly (/E/9/R)>!.tmp
- goat %1 /c /e/9/r >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe3
- type !.tmp
- :rexe3
-
- echo MZ header-512, 0-filled, code at bottom, JMP present, readonly (/E/B/R)>!.tmp
- goat %1 /c /e/b/r/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe4
- type !.tmp
- :rexe4
-
- echo MZ header-512, NOPs-filled, code at bottom, JMP present, readonly (/E/B/9/R)>!.tmp
- goat %1 /c /e/b/9/r >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe5
- type !.tmp
- :rexe5
-
- echo MZ header-512, 0-filled, code at bottom, no JMP, readonly (/E/B/J/R)>!.tmp
- goat %1 /c /e/b/j/r/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe6
- type !.tmp
- :rexe6
-
- echo MZ header-512, NOPs-filled, code at bottom, no JMP, readonly (/E/B/9/J/R)>!.tmp
- goat %1 /c /e/b/9/j/r >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe7
- type !.tmp
- :rexe7
-
- echo
- echo
- echo │Creating EXE files with 32-bytes header.
- echo └────────────────────────────────────────────────
- echo
-
- echo >>goatset.log
- echo >>goatset.log
- echo │Creating EXE files with 32-bytes header. >>goatset.log
- echo └──────────────────────────────────────────────── >>goatset.log
- echo >>goatset.log
-
- echo EXE file (MZ header-32), 0-filled, code at start, JMP present (/E2)>!.tmp
- goat %1 /c /e2/i0 >>!.tmp
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe8
- type !.tmp
- :exe8
-
- echo EXE file (MZ header-32), 0-filled, code at start, no JMP (/E2/J)>!.tmp
- goat %1 /c /e2/j/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe9
- type !.tmp
- :exe9
-
- echo EXE file (MZ header-32), NOPs-filled, code at start, JMP present (/E2/9)>!.tmp
- goat %1 /c /e2/9 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe10
- type !.tmp
- :exe10
-
- echo EXE file (MZ header-32), 0-filled, code at bottom, JMP present (/E2/B)>!.tmp
- goat %1 /c /e2/b/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe11
- type !.tmp
- :exe11
-
- echo EXE file (MZ header-32), NOPs-filled, code at bottom, JMP present (/E2/B/9)>!.tmp
- goat %1 /c /e2/b/9 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe12
- type !.tmp
- :exe12
-
- echo EXE file (MZ header-32), 0-filled, code at bottom, no JMP (/E2/B/J)>!.tmp
- goat %1 /c /e2/b/j/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe13
- type !.tmp
- :exe13
-
- echo EXE file (MZ header-32), 0-filled, code at bottom, no JMP (/E2/B/9/J)>!.tmp
- goat %1 /c /e2/b/9/j/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe14
- type !.tmp
- :exe14
-
- echo MZ header-32, 0-filled, code at start, JMP present, readonly (/E2/R)>!.tmp
- goat %1 /c /e2/r/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe8
- type !.tmp
- :rexe8
-
- echo MZ header-32, 0-filled, code at start, no JMP, readonly (/E2/J/R)>!.tmp
- goat %1 /c /e2/j/r/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe9
- type !.tmp
- :rexe9
-
- echo MZ header-32, NOPs-filled, code at start, JMP present, readonly (/E2/9/R)>!.tmp
- goat %1 /c /e2/9/r >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe10
- type !.tmp
- :rexe10
-
- echo MZ header-32, 0-filled, code at bottom, JMP present, readonly (/E2/B/R)>!.tmp
- goat %1 /c /e2/b/r/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe11
- type !.tmp
- :rexe11
-
- echo MZ header-32, NOPs-filled, code at bottom, JMP present, readonly (/E2/B/9/R)>!.tmp
- goat %1 /c /e2/b/9/r >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe12
- type !.tmp
- :rexe12
-
- echo MZ header-32, 0-filled, code at bottom, no JMP, readonly (/E2/B/J/R)>!.tmp
- goat %1 /c /e2/b/j/r/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe13
- type !.tmp
- :rexe13
-
- echo MZ header-32, 0-filled, code at bottom, no JMP, readonly (/E2/B/9/J/R)>!.tmp
- goat %1 /c /e2/b/9/j/r/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto rexe14
- type !.tmp
- :rexe14
-
- echo
- echo
- echo │Varying EXE internal structure ('ZM', SS/SP and stack).
- echo └──────────────────────────────────────────────────────────────
- echo
-
- echo >>goatset.log
- echo >>goatset.log
- echo │Varying EXE internal structure ('ZM', SS/SP and stack). >>goatset.log
- echo └────────────────────────────────────────────────────────────── >>goatset.log
- echo >>goatset.log
-
- echo EXE file (ZM header-512), 0-filled, code at bottom, JMP (/Z/B/V)>!.tmp
- goat %1 /c /z/b/v/i0 >>!.tmp
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe15
- type !.tmp
- :exe15
-
- echo EXE file (ZM header-32), 0-filled, code at bottom, JMP (/Z/E2/B/V)>!.tmp
- goat %1 /c /z/e2/b/v/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe16
- type !.tmp
- :exe16
-
- echo EXE file (MZ header-512), 0-filled, code at bottom, JMP, SP=IP, SS=CS (/E/B/V)>!.tmp
- goat %1 /c /e/b/v/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe17
- type !.tmp
- :exe17
-
- echo EXE file (MZ header-32), 0-filled, code at bottom, JMP, SP=IP, SS=CS (/E2/B/V)>!.tmp
- goat %1 /c /e2/b/v/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe18
- type !.tmp
- :exe18
-
- echo EXE file (MZ header-512), 0-filled, code at bottom, JMP & STACK (/E/B/K256)>!.tmp
- goat %1 /c /e/b/k256/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe19
- type !.tmp
- :exe19
-
- echo EXE file (MZ header-32), 0-filled, code at bottom, JMP & STACK (/E2/B/K256)>!.tmp
- goat %1 /c /e2/b/k256/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto exe20
- type !.tmp
- :exe20
-
- echo
- echo
- echo │Creating device drivers (SYS) with SYS-COM and SYS-EXE structure
- echo └────────────────────────────────────────────────────────────────
- echo
-
- echo >>goatset.log
- echo >>goatset.log
- echo │Creating device drivers (SYS) with SYS-COM and SYS-EXE structure >>goatset.log
- echo └──────────────────────────────────────────────────────────────── >>goatset.log
- echo >>goatset.log
-
- echo SYS file (simple), 0-filled, code at start (/Y)>!.tmp
- goat %1 /c /y/i0 >>!.tmp
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto sys1
- type !.tmp
- :sys1
-
- echo SYS file (simple), 0-filled, code at bottom (/Y/B)>!.tmp
- goat %1 /c /y/b/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto sys2
- type !.tmp
- :sys2
-
- echo SYS-EXE file (MZ header-512), 0-filled, code at start (/Y/E)>!.tmp
- goat %1 /c /y/e/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto sys3
- type !.tmp
- :sys3
-
- echo SYS-EXE file (MZ header-512), 0-filled, code at bottom (/Y/E/B)>!.tmp
- goat %1 /c /y/e/b/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto sys4
- type !.tmp
- :sys4
-
- echo SYS-EXE file (MZ header-32), 0-filled, code at start (/Y/E2)>!.tmp
- goat %1 /c /y/e2/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto sys5
- type !.tmp
- :sys5
-
- echo SYS-EXE file (MZ header-32), 0-filled, code at bottom (/Y/E2/B)>!.tmp
- goat %1 /c /y/e2/b/i0 >>!.tmp
- echo
- echo >>goatset.log
- type !.tmp>>goatset.log
-
- if ERRORLEVEL 2 goto end
- if ERRORLEVEL 1 goto sys6
- type !.tmp
- :sys6
-
- echo │Inspect GOATSET.LOG file for the protocol of a set generation.
- echo └──────────────────────────────────────────────────────────────
- goto end
-
- :Usage
- echo GOATSET.BAT - Version 4.2 - (C) MIG - Not for commercial use.
- echo
- echo Usage: GOATSET.BAT Size
- echo
- echo Size - decimal, hexadecimal, or in kbytes
- echo (Example: 10000, 65530, 3E00h, FF00h, 31k, 512K, 2048k)
- echo
- echo Files created: GOAT000.COM, GOAT001.COM, ... GOAT049.EXE.
- echo
- echo Author: Igor G. Muttik, Virus Lab, S&S International, Aylesbury, UK, HP19 3XU
- echo Email: MIG@sands.co.uk, MIG@lt.phys.msu.su Phone: +44 1296 318700 ext.2756
- echo
- goto end
-
- :invalid
- @echo Size specified is too small.
-
- :end
- if EXIST !.tmp del !.tmp
-